﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/BodyMasterPage.Master"
   CodeBehind="wfUsuarioBnd.aspx.cs" Inherits="SY.wfUsuarioBnd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
   <script type="text/javascript">
      window.onload = function () {
         this.ResizeGrid();
         this.MessageOnPostback();
      }

      function ResizeGrid() {
         internalGridResize("<%= grdList.ClientID %>");
     }

     function demotokenfunction() {
         var vartoken = $("#textFilter").tokenInput("get");
         document.getElementById("<%=hdnFilter.ClientID%>").value = JSON.stringify(vartoken);
     }

//      function panelOnUpdating() {
//         updatePanelAnimationUpdating();
//      }

//      function panelOnUpdated() {
//         ResizeGrid();
//         updatePanelAnimationUpdated();
//      }
   </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
   <div class="ToolBar">
      <asp:Menu ID="mnuToolbar" CssClass="ToolBarControl" runat="server" Orientation="Horizontal"
         OnMenuItemClick="mnuToolbar_MenuItemClick">
         <Items>
            <asp:MenuItem Text="Nuevo" Value="_BTTNEW" ImageUrl="../Images/Icons/Enabled/New.png">
            </asp:MenuItem>
         </Items>
      </asp:Menu>
   </div>
   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate>
         <div class="DataHeader">
            <table id="TableDataHeader" cellpadding="0" cellspacing="0">
                <tr>
                    <td colspan="3">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                    <td>
                     <table width="100%" cellpadding="0" cellspacing="2">
                        <tr>
                            <td rowspan="3">
                                <esd:esdFilterText ID="textFilter" runat="server" />
                            </td>
                            <td style="width: 90px;">
                                <esd:esdButton ID="bttClear" runat="server" Text="Limpiar" Width="80px">
                                </esd:esdButton>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <esd:esdButton ID="bttSearch" runat="server" Text="Buscar" Width="80px" OnClick="bttOk_Click">
                              </esd:esdButton>
                            </td>
                        </tr>
                    </table>
                    </td>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;
                    </td>
                </tr>          
            </table>
         </div>
         <div class="DataDetail">
            <esd:esdGridView CssClass="esdGridView" ID="grdList" runat="server" ScrollWidth="100%"
               Width="100%" ShowHeaderWhenEmpty="True" AutoGenerateColumns="False" DataKeyNames="RowNumber"
               OnRowCommand="grdList_RowCommand">
               <Columns>
                  <asp:TemplateField>
                     <ItemTemplate>
                        <asp:ImageButton ID="grdBttCmdEdit" CommandName="CmdEdit" CommandArgument="<%# Container.DataItemIndex %>"
                           runat="server" ImageUrl="../Images/Icons/Enabled/Edit.png" ToolTip="Modificar el Registro" />
                     </ItemTemplate>
                     <HeaderStyle Width="22px" />
                     <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                  </asp:TemplateField>
                  <asp:TemplateField>
                     <ItemTemplate>
                        <asp:ImageButton ID="grdBttCmdDel" CommandName="CmdDel" CommandArgument="<%# Container.DataItemIndex %>"
                           runat="server" ImageUrl="../Images/Icons/Enabled/Delete.png" ToolTip="Eliminar/Anular el Registro" />
                     </ItemTemplate>
                     <HeaderStyle Width="22px" />
                     <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                  </asp:TemplateField>
                  <asp:BoundField DataField="idUser" HeaderStyle-CssClass="hideDataGridColumn" ItemStyle-CssClass="hideDataGridColumn">
                  </asp:BoundField>
                  <asp:TemplateField>
                    <HeaderTemplate>
                        <esd:esdFilterPanel ID="idLogon" 
                            Identity="a.idLogon" 
                            runat="server" 
                            Title="Usuario" 
                            ControlToken="textFilter" 
                            FilterType="esdDateTexbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("idLogon")%>
                    </ItemTemplate>
                  </asp:TemplateField>
                  <asp:TemplateField>
                    <HeaderTemplate>
                        <esd:esdFilterPanel ID="dsNombres" 
                            Identity="a.dsNombres" 
                            runat="server" 
                            Title="Nombres" 
                            ControlToken="textFilter" 
                            FilterType="esdDateTexbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%#Eval("dsNombres")%>
                    </ItemTemplate>
                  </asp:TemplateField>
                  <%--<asp:BoundField DataField="idLogon" HeaderText="Usuario"></asp:BoundField>--%>
                  <%--<asp:BoundField DataField="dsNombres" HeaderText="Nombres"></asp:BoundField>--%>
                  <asp:BoundField DataField="stRegSist" HeaderStyle-CssClass="hideDataGridColumn" ItemStyle-CssClass="hideDataGridColumn">
                  </asp:BoundField>
                  <asp:BoundField DataField="stAnulado" HeaderStyle-CssClass="hideDataGridColumn" ItemStyle-CssClass="hideDataGridColumn">
                  </asp:BoundField>
               </Columns>
               <EmptyDataTemplate>
                  <div id="gridempty">
                     <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />
                     &nbsp;No existen registros para esta solicitud.
                  </div>
               </EmptyDataTemplate>
            </esd:esdGridView>
         </div>
         <asp:HiddenField ID="hdnFilter" runat="server" />
         <asp:HiddenField ID="hdnMsgOPB" runat="server" />
      </ContentTemplate>
   </asp:UpdatePanel>
   <ajax:UpdatePanelAnimationExtender ID="upae" BehaviorID="animation" runat="server"
      TargetControlID="updatePanel1">
      <animations>
        <OnUpdating>
        <Parallel duration="0.5">
            <ScriptAction Script="panelOnUpdating();" />  
        </Parallel>
        </OnUpdating>
        <OnUpdated>
        <Parallel duration="0.5">
            <ScriptAction Script="panelOnUpdated();" /> 
        </Parallel> 
        </OnUpdated>
    </animations>
   </ajax:UpdatePanelAnimationExtender>
   <div id="updateProgressDiv" class="updateProgress" style="display: none">
      <table width="100%">
         <tr>
            <td valign="middle">
               <img src="../Images/Controls/Loading.gif" />
            </td>
            <td valign="middle">
               <span class="updateProgressMessage">Cargando ...</span>
            </td>
         </tr>
      </table>
   </div>
</asp:Content>
